---
title: react-native-svg
description: A library that allows using SVGs in your app.
sourceCodeUrl: 'https://github.com/react-native-community/react-native-svg'
packageName: react-native-svg
platforms: ['android', 'ios', 'macos', 'web', 'tvos']
inExpoGo: true
---

import { BookOpen02Icon } from '@expo/styleguide-icons/outline/BookOpen02Icon';

import { APIInstallSection } from '~/components/plugins/InstallSection';
import { BoxLink } from '~/ui/components/BoxLink';
import { SnackInline } from '~/ui/components/Snippet';
import { MONOSPACE } from '~/ui/components/Text';

`react-native-svg` allows you to use SVGs in your app, with support for interactivity and animation.

## Installation

<APIInstallSection href="https://github.com/react-native-community/react-native-svg#with-react-native-cli" />

## API

```js
import * as Svg from 'react-native-svg';
```

### <MONOSPACE>Svg</MONOSPACE>

A set of drawing primitives such as `Circle`, `Rect`, `Path`,
`ClipPath`, and `Polygon`. It supports most SVG elements and properties.
The implementation is provided by [react-native-svg](https://github.com/react-native-community/react-native-svg), and documentation is provided in that repository.

<SnackInline label='SVG' dependencies={['react-native-svg']}>

```tsx
import Svg, { Circle, Rect } from 'react-native-svg';

export default function SvgComponent(props) {
  return (
    <Svg height="50%" width="50%" viewBox="0 0 100 100" {...props}>
      <Circle cx="50" cy="50" r="45" stroke="blue" strokeWidth="2.5" fill="green" />
      <Rect x="15" y="15" width="70" height="70" stroke="red" strokeWidth="2" fill="yellow" />
    </Svg>
  );
}
```

</SnackInline>

### Tips

Here are some helpful links that will get you moving fast!

- Looking for SVGs? Try the [noun project](https://thenounproject.com/).
- Create or modify your own SVGs for free using [Figma](https://www.figma.com/).
- Optimize your SVG with [SVGOMG](https://jakearchibald.github.io/svgomg/). This will make the code smaller and easier to work with. Be sure not to remove the `viewbox` for best results on Android.
- Convert your SVG to an Expo component in the browser using [SVGR](https://react-svgr.com/playground/?native=true&typescript=true).

## Learn more

<BoxLink
  title="Visit official documentation"
  description="Get full information on API and its usage."
  Icon={BookOpen02Icon}
  href="https://github.com/software-mansion/react-native-svg"
/>
